<html>
<head><meta charset="utf-8"><title>https://github.com/rust-lang/rustc-dev-guide/pull/724 · t-compiler/wg-rustc-dev-guide · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/index.html">t-compiler/wg-rustc-dev-guide</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html">https://github.com/rust-lang/rustc-dev-guide/pull/724</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199039728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199039728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199039728">(May 28 2020 at 15:39)</a>:</h4>
<p>A tidy fail on same line error annotation line length prompted <a href="https://github.com/rust-lang/rustc-dev-guide/pull/724">https://github.com/rust-lang/rustc-dev-guide/pull/724</a>.  It includes examples of the UI test error annotation idioms used to define expected error strings and source line locations.  </p>
<p>Are there any other tips/tricks out there that would be helpful in this area of the guide?</p>



<a name="199056653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199056653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199056653">(May 28 2020 at 17:49)</a>:</h4>
<p>One thing is that you don't need to quote the whole error in the annotation</p>



<a name="199056680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199056680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199056680">(May 28 2020 at 17:49)</a>:</h4>
<p>You only need a prefix (or maybe it was a substring?)</p>



<a name="199056803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199056803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199056803">(May 28 2020 at 17:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="198054">mark-i-m</span> <a href="#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724/near/199056680">said</a>:</p>
<blockquote>
<p>You only need a prefix (or maybe it was a substring?)</p>
</blockquote>
<p>Ah, interesting.  I wasn't aware of this.  yes, will definitely work that in.  Is there a min length required?</p>



<a name="199056933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199056933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199056933">(May 28 2020 at 17:51)</a>:</h4>
<p>Looks like this may have been merged. I will open a new PR with this addition. Ty!</p>



<a name="199057116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199057116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199057116">(May 28 2020 at 17:52)</a>:</h4>
<p>where is the source that defines these error annotations in UI tests?</p>



<a name="199058121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199058121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199058121">(May 28 2020 at 18:00)</a>:</h4>
<p><span class="user-mention silent" data-user-id="198054">mark-i-m</span> <a href="#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724/near/199056653">said</a>:</p>
<blockquote>
<p>One thing is that you don't need to quote the whole error in the annotation</p>
</blockquote>
<p>Good point! yeah, we sometimes use a short one. For example, we can avoid including changeable values/wording as annotation</p>



<a name="199058169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199058169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199058169">(May 28 2020 at 18:01)</a>:</h4>
<p>There is no minimum length tmk, but it needs to be long enough to be self-documenting (i.e. you should need to read the .stderr file)</p>



<a name="199058377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199058377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199058377">(May 28 2020 at 18:02)</a>:</h4>
<p>Here is some more discussion: <a href="#narrow/stream/131828-t-compiler/topic/ui.20test.20comments">https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/ui.20test.20comments</a></p>



<a name="199058493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199058493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199058493">(May 28 2020 at 18:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="262810">Chris Simpkins</span> <a href="#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724/near/199057116">said</a>:</p>
<blockquote>
<p>where is the source that defines these error annotations in UI tests?</p>
</blockquote>
<p>I found it once, but I forgot</p>



<a name="199058519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199058519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199058519">(May 28 2020 at 18:03)</a>:</h4>
<p>just a quick skim, but I think it is here: <a href="https://github.com/rust-lang/rust/blob/master/src/tools/compiletest/src/errors.rs">https://github.com/rust-lang/rust/blob/master/src/tools/compiletest/src/errors.rs</a></p>



<a name="199058555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199058555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199058555">(May 28 2020 at 18:03)</a>:</h4>
<p>ty!</p>



<a name="199058570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199058570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199058570">(May 28 2020 at 18:03)</a>:</h4>
<p>np :)</p>



<a name="199081492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https%3A//github.com/rust-lang/rustc-dev-guide/pull/724/near/199081492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Simpkins <a href="https://rust-lang.github.io/zulip_archive/stream/196385-t-compiler/wg-rustc-dev-guide/topic/https.3A.2F.2Fgithub.2Ecom.2Frust-lang.2Frustc-dev-guide.2Fpull.2F724.html#199081492">(May 28 2020 at 20:23)</a>:</h4>
<p><a href="https://github.com/rust-lang/rustc-dev-guide/pull/725">https://github.com/rust-lang/rustc-dev-guide/pull/725</a> adds <span class="user-mention silent" data-user-id="198054">mark-i-m</span>'s tip</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>